home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 June: Reference Library / Dev.CD Jun 00 RL Disk 1.toast / pc / technical documentation / develop / develop issue 26 / develop issue 26 code / qd3d custom attributes / customattribute / customattribute_lib.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-01  |  2.1 KB  |  117 lines

  1. #ifndef __CUSTOMATTRIBUTE_LIB__
  2. #define __CUSTOMATTRIBUTE_LIB__
  3.  
  4. #ifndef QD3D_h
  5. #include "QD3D.h"
  6. #endif
  7.  
  8. #ifndef QD3DPick_h
  9. #include "QD3DPick.h"
  10. #endif
  11.  
  12. #ifndef _STRING
  13. #include <string.h>
  14. #endif
  15.  
  16. /* Here we define the new types */
  17.  
  18. #define kElementTypeName                'name'
  19. #define kElementTypeScale                'scle'
  20. #define kElementTypeUpVector            'upvt'
  21. #define kElementTypeForwardDirection    'fwrd'
  22. #define kElementTypeW3Anchor            'w3nr'
  23. #define kElementTypeW3Inline            'w3nl'
  24.  
  25. typedef enum W3AnchorOptions {
  26.     kW3AnchorOptionNone            =  0,
  27.     kW3AnchorOptionUseMap        =  1
  28. } W3AnchorOptions;
  29.  
  30. typedef struct W3AnchorData {
  31.     char                *url;
  32.     TQ3StringObject        description;
  33.     W3AnchorOptions    options;
  34. } W3AnchorData;
  35.  
  36. typedef struct W3InlineData {
  37.     char                *url;
  38. } W3InlineData;
  39.  
  40. /*
  41.  *    Call this to register all the custom attributes
  42.  *    
  43.  *    One call does it all
  44.  */
  45. #ifdef __cplusplus
  46. extern "C" {
  47. #endif    /* __cplusplus */
  48.  
  49. void RegisterAllCustomAttributes(void);
  50.  
  51. void UnregisterAllCustomAttributes(void);
  52.  
  53. /*
  54.  *    Convenience routines for setting elements
  55.  *    
  56.  */
  57.  
  58. TQ3Status SetName(
  59.     TQ3Object    object,
  60.     char        *name);
  61.  
  62. TQ3Status SetScale(
  63.     TQ3Object    object,
  64.     double        scale);
  65.  
  66. TQ3Status SetUpVector(
  67.     TQ3Object    object,
  68.     TQ3Vector3D    *upVector);
  69.  
  70. TQ3Status SetForwardDirection(
  71.     TQ3Object    object,
  72.     TQ3Vector3D    *forwardDirection);
  73.  
  74. TQ3Status SetW3Anchor(
  75.     TQ3Object            object,
  76.     char                *url,
  77.     char                *description,
  78.     W3AnchorOptions options);
  79.     
  80. TQ3Status SetW3Inline(
  81.     TQ3Object    object,
  82.     char        *url);
  83.     
  84. TQ3Boolean W3Anchor_GetFromObject(
  85.     TQ3Object object,
  86.     W3AnchorData *data);
  87.  
  88. TQ3Boolean W3Anchor_GetFromSet(
  89.     TQ3SetObject set,
  90.     W3AnchorData *data);
  91.  
  92. TQ3Boolean W3Anchor_GetFromHitData(
  93.     const TQ3HitData *hitData, 
  94.     W3AnchorData *data);
  95.     
  96. void W3Anchor_Empty (
  97.     W3AnchorData *URLData);
  98.  
  99.  
  100. #ifdef __cplusplus
  101. }
  102. #endif  /*  __cplusplus  */
  103.  
  104. /*
  105.  *    Note
  106.  *    
  107.  *    kElementNameWWWAnchor is obsolete and has been replaced by kElementW3Anchor.
  108.  */
  109. #define kElementTypeWWWAnchor    ((TQ3ElementType) Q3_OBJECT_TYPE('w','w','w','a'))
  110. #define kElementNameWWWAnchor    "WWWAnchor"
  111.  
  112. typedef struct WWWAnchorData {
  113.     char    *url;
  114. } WWWAnchorData;
  115.  
  116. #endif
  117.